﻿<%@ Page Language="C#" MasterPageFile="~/Template/List.master" AutoEventWireup="true"
    CodeFile="ManagePostList.aspx.cs" Inherits="PostBoard_ManagePostList" %>

<%@ Register Src="~/Control/ListHeader.ascx" TagName="ListHeader" TagPrefix="wsc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    

    <script type="text/javascript" src="../Js/jquery-1.2.6.min.js"></script>

    <script type="text/javascript" src="../Js/jquery-1.2.6-vsdoc.js"></script>

    <script type="text/javascript">

        function addPost() {
            var width = 350;
            var height = 320;
            window.open("NewPostDetail.aspx?Type=Add&Nocache=" + Math.random(), "newwindow", 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=' + (screen.width - width) / 2 + ',top=' + (screen.height - height) / 2);
        }
       
       function editPost(postid)
        {
            var width = 350;
            var height = 320;
            window.open("NewPostDetail.aspx?PostID="+postid+"&Type=Edit&Nocache=" + Math.random(), "newwindow", 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=' + (screen.width - width) / 2 + ',top=' + (screen.height - height) / 2);
        }
       
        function advancedSearchClick() {
            if (window.event.keyCode == 13) {
                document.getElementById("<%=btnAdvancedSearch.ClientID %>").click();
            }
        }
        function searchClick() {
            if (window.event.keyCode == 13) {
                document.getElementById("<%=btnSearch.ClientID %>").click();
            }
        }
        function refresh() {
            document.getElementById("<%=btnRefresh.ClientID %>").click();
        }

        function clearText(control, text) {
            if (control.value == text)
                control.innerText = "";
        }
        function insertText(control, text) {
            if (control.value == "")
                control.innerText = text;
        }

        function deleteUser() {
            document.getElementById("<%=btnDelete.ClientID %>").click();
        }
        function stopBubble(e, id) {
            var e = e ? e : window.event;
            if (window.event) { // IE   
                e.cancelBubble = true;
            } else { // FF   
                //e.preventDefault();    
                e.stopPropagation();
            }
            OpenDetail('ClassMemberList.aspx?ClassID=' + id + '&IsSelectClass=true&Nocache=' + Math.random());
        }   
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitlePlaceHolder" runat="Server">
    留言管理
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ListToolBarPlaceHolder" runat="Server">
    <div style="display: none">
        <asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" />
        <asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" />
    </div>
    <table cellspacing="2" cellpadding="0" border="0" width="100%">
        <tr>
            <td>                
                <table cellspacing="0" cellpadding="0" border="0" class="TableSearch" width="100%">
                    <tr>
                        <td width="100%">
                            <asp:TextBox ID="tbSearch" runat="server" CssClass="TextBox"></asp:TextBox>
                        </td>
                        <td width="10">
                            <asp:LinkButton ID="btnSearch" runat="server" OnClick="btnSearch_Click"><img alt="<%=SearchDefaultText %>" src="../Images/Icon/Icon-Search.png" align="absmiddle" style="cursor: pointer;" /></asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="AdvancedSearchPlaceHolder" runat="server">
    <table cellspacing="4" cellpadding="0" border="0" width="100%">
        <tr>
            <td width="60">
                留言标题
            </td>
            <td>
                <asp:TextBox ID="tbSearchTitle" runat="server" class="Textbox01" Width="100%"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="right">
                <asp:Button ID="btnAdvancedSearch" runat="server" CssClass="Button01" Text="查询" OnClientClick=""
                    OnClick="btnAdvancedSearch_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ListHeaderPlaceHolder" runat="Server">
    <table cellspacing="0" cellpadding="0" border="0" class="PageGridHeader" width="100%">
        <wsc:ListHeader ID="lhApplyIcon" runat="server" Title="" Width="30" OrderColumn="IsRead" />
        <wsc:ListHeader ID="lhPostTitle" runat="server" Title="标题" OrderColumn="PostTitle"
            Align="center" />
        <wsc:ListHeader ID="lhPostTime" runat="server" Title="提交时间" Width="100" Align="center"
            OrderColumn="PostTime" FirstOrderDirection="Desc" />
        <wsc:ListHeader ID="lhPosterDsName" runat="server" Title="提交人" Width="80" OrderColumn="PosterDsName"
            Align="center" />
        <wsc:ListHeader ID="lhOperate" runat="server" Title="操作" Width="60" Align="center" />
    </table>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ListContentPlaceHolder" runat="Server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="MainInfolist">
        <asp:Repeater ID="rptPostList" runat="server" OnItemDataBound="rptPostList_OnItemDataBound"
            OnItemCommand="rptPostList_OnItemCommand">
            <ItemTemplate>
                <tr id="TableRow_<%# Container.ItemIndex%>" style="cursor: hand; text-align: left;"
                    class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)"
                    onclick="ClickChangeClass(this);OpenDetail('PostDetail.aspx?PostID=<%# DataBinder.Eval(Container.DataItem, "ID")%>&Type=View&Nocache=' + Math.random());">
                    <td style="display: none;">
                        <%# DataBinder.Eval(Container.DataItem,"ID") %>
                    </td>
                    <td style="text-align: center; width: 30px;">
                        <asp:Image runat="server" ID="imgSign" />
                    </td>
                    <td>
                        <span title='<%# DataBinder.Eval(Container.DataItem, "PostTitle")%>' style="<%# DataBinder.Eval(Container.DataItem, "TitleStyle")%>">
                            <%# WebCommon.Cut(DataBinder.Eval(Container.DataItem, "PostTitle"),15)%></span>
                    </td>
                    <td style="text-align: center; width: 100px;" title='<%# DataBinder.Eval(Container.DataItem, "PostTime")%>'>
                        <%# DataBinder.Eval(Container.DataItem, "PostTime", "{0:yyyy-MM-dd}")%>
                    </td>
                    <td style="text-align: center; width: 80px;">
                        <span title='<%# DataBinder.Eval(Container.DataItem, "PosterDsName")%>'>
                            <%# DataBinder.Eval(Container.DataItem, "PosterDsName")%></span>
                    </td>
                    <td style="text-align: center; width: 60px;">
                        <img alt="编辑" src="../Images/Icon/Action/edit.gif" onclick="editPost('<%# DataBinder.Eval(Container.DataItem, "ID")%>')" />
                        <asp:ImageButton ID="ibtnDelete" ImageUrl="../Images/Icon/Action/delete.gif" runat="server"
                            ToolTip="删除" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID")%>' />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
</asp:Content>
